package cn.xuchunh.campusbbs.ui.fragments.dialog;

import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatDialogFragment;
import android.webkit.WebView;

import cn.xuchunh.campusbbs.R;

/**
 * Created by XuChunH on 2015/10/12.
 */
public class CreditsDialog extends AppCompatDialogFragment{

    public CreditsDialog() {
    }

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
        WebView webView = new WebView(getActivity());
        webView.loadUrl("file:///android_asset/credits.html");
        return builder.setTitle("版权信息")
                .setView(webView)
                .setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {

                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                    }
                }).create();
    }
}
